package framework.model;

/**
 * Created by chencs on 2017/4/15.
 */
public class Pager {

    private int page;

    private int rows;

    public int startRow;

    public void initPager() {
        if(page == 0) {
            this.startRow = 0;
        } else {
            this.startRow = (page - 1) * rows;
        }
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    @Override
    public String toString() {
        return "Pager{" +
                "page=" + page +
                ", rows=" + rows +
                ", startRow=" + startRow +
                '}';
    }
}
